function modify(name1) {
	$("#" + name1).find("input").removeAttr("disabled");
	$("#" + name1).find("button").css('display', 'block');
}
function submited(name1, name2) {
	$("#" + name1).find("input").attr("disabled", "disabled");
	$("#" + name1).find("button").css('display', 'none');
}
function modify2(name) {
	$("." + name).find("button").css('display', 'block');
}
function addToCart(productId, addorless, price) {
	$.post("http://localhost:8080/bishe/Product/addToCart?productId="
			+ productId, {
		addOrless : addorless,
		dataType : "json"
	}, function(data) {
		$("#productamount" + productId).text(data);
		$("#producttotal" + productId).text(data * price);
		if ('-' === addorless) {
			if ($("#number").text() != 0) {
				$("#number").text($("#number").text() - 1);
				$("#totals").text($("#totals").text() - price);
			}
		} else {
			$("#number").text($("#number").text() - 1 + 2);
			$("#totals").text($("#totals").text() - 1 + 1 + price);
		}

	});
}

function placeOrder(storeId, totalprice) {
	var params = {};
	params.storeId = storeId;
	params.totalprice = totalprice;
	$.ajax({
		url : "http://localhost:8080/bishe/OrderDetail/addOrder",
		method : "post",
		dataType : "json",
		data : params
	});
}

function chenge(code) {

	var params = {};
	params.code = code;

	if (confirm("是否确定取消！")) {
		$.ajax({
			url : "http://localhost:8080/bishe/OrderDetail/chenge",
			method : "post",
			dataType : "json",
			data : params
		});
	}
}

function changestorestatus(useraddress, storeid) {
	var params = {};
	params.statusId = $("#" + useraddress + storeid).val();
	params.id = storeid;
	$.ajax({
		url : "http://localhost:8080/bishe/Store/changeStoreStatus",
		method : "post",
		dataType : "json",
		data : params
	});
}